﻿#ifndef PST_DATACHOSENLISTDIALOG_H
#define PST_DATACHOSENLISTDIALOG_H

#include <QWidget.h>
#include <QItemSelection>
#include <QModelIndexList>
#include "BaseWidget/IdaDialogFrame.h"
#include "BaseWidget/SelectAllButtonBar.h"
QT_BEGIN_NAMESPACE
namespace Ui { class DataChosenListDialog; };
class QListView;
class QCheckBox;
class QVBoxLayout;
QT_END_NAMESPACE

namespace pst
{
    class DataChosenListDialog : public IdaDialogFrame
    {
        Q_OBJECT
    public:
        DataChosenListDialog(QWidget* parent = nullptr);
        ~DataChosenListDialog();

        void setData(const QList<QString>& data);
        QList<QString> getData() const;
        void updateUI();
        void setSelctedIndexs(const QList<int>& indexs);
        void setMultipleSelected(bool isMultipleSelected);
    signals:
        void signal_sentChosenDataIds(const QModelIndexList& chosenID);

    private slots:
        void slot_selectionChanged(
            const QItemSelection& selected,
            const QItemSelection& deselected);

        void slot_ModifyListSelectedStatus(int state);

        void slot_okButtonClicked();
    private:
        Ui::DataChosenListDialog* ui;
        QList<QString> m_data;
        bool m_isMultipleSelected{true};   
        BaseWidget::SelectAllButtonBar* m_selectAllButtonBar{};
        //QListView* _listView;
        //QVBoxLayout* _page1Layout;
        //QCheckBox* _chooseAllCheckBox;
    };
}

#endif
